#include <bits/stdc++.h>
using namespace std;
int n;
int gg(int k){
	if(k%3==0)return k/3;
	return k;
}
int main(){
//	freopen("batman.in","r",stdin);
//	freopen("batman.out","w",stdout);
	cin>>n;
	cout<<gg(n)<<endl;
	return 0;
}
